<template>
    <div class="container">
        <div class="menu-left">
            <ul>
                <!-- <li @click="addnews">新闻添加</li> -->
                <!-- <li @click="newslist">新闻列表</li> -->
                <router-link tag="li" :to="{name:'addnews'}">新闻添加</router-link>
                <router-link tag="li" :to="{name:'newslist'}">新闻列表</router-link>
            </ul>
        </div>
        <!-- <iframe src="../views/AddNewsPage.vue" frameborder="0" width="800px"> 
            
            </iframe>   -->
            <router-view></router-view>
    </div>
</template>

<script>
//   let lis = document.querySelectorAll("li");
//     Array.from(lis).forEach(v => {
//         v.onclick = function () {
//             Array.from(lis).forEach(value => {
//                 if (this == value) {
//                     this.style.color = "rgb(255, 208, 75)";
//                     // let iframeNode = document.querySelector("iframe");
//                     if (this.textContent == "新闻添加") {
//                         console.log(this.$route);
//                         // iframeNode.src = "../views/AddNewsPage.vue";
//                     } else {
//                         //新闻列表
//                         // iframeNode.src = "../views/NewListPage.vue";

//                     }
//                 } else {
//                     value.style.color = "white";
//                 }
//             })
//         }
//     })
export default {
    data(){
        return{

        }
    },
    // methods:{
    //     addnews(){
    //        if(this.$route.path!="/news/addnews"){
    //            this.$router.push({name:"addnews"});
    //        }else{
    //            console.log(1);
    //        }
    //     },
    //     newslist(){
    //         if(this.$route.path!="/news/newslist"){
    //             this.$router.push({name:"newslist"});
    //         }else{
    //            console.log(1);
    //        }
    //     }
    // }
}
</script>

<style scoped>
body {
    margin: 0;
}

.container {
    display: flex;
    flex-direction: row;
}

ul {
    display: flex;
    width: 200px;
    flex-direction: column;
    padding: 0;
}

li {
    float: left;
    display: block;
    list-style: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    line-height: 56px;
    text-align: center;
}

li:hover {
    background: rgb(84, 92, 100);
}

.menu-left {
    width: 200px;
    background: rgb(67, 74, 80);
    height: 950px;
    float: left;
    display: block;
}

.menu-content {
    flex: 1;
    padding-left: 40px;

}

.addInput div {
    margin-top: 30px;
}

.title {
    -webkit-appearance: none;
    background-color: #fff;
    background-image: none;
    border-radius: 4px;
    border: 1px solid #dcdfe6;
    box-sizing: border-box;
    color: #606266;
    display: inline-block;
    font-size: inherit;
    height: 40px;
    line-height: 40px;
    outline: none;
    padding: 0 15px;
}

.content {
    display: block;
    resize: vertical;
    padding: 5px 15px;
    line-height: 1.5;
    box-sizing: border-box;
    width: 300px;
    height: 100px;
    font-size: inherit;
    color: #606266;
    background-color: #fff;
    background-image: none;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
}

.addInput div input:focus {
    outline: none;
    border-color: #409eff;
}

.contentContainer {
    display: flex;
}

.selectStyle {
    background-color: #fff;
    background-image: none;
    border-radius: 4px;
    border: 1px solid #dcdfe6;
    box-sizing: border-box;
    color: #606266;
    display: inline-block;
    font-size: inherit;
    height: 40px;
    line-height: 40px;
    outline: none;
    padding: 0 15px;
    width: 200px;
}

.fileinput-button {
    position: relative;
    display: inline-block;
    overflow: hidden;
    background: #409eff;
    padding: 9px 15px;
    font-size: 12px;
    border-radius: 3px;
    color: white;

}

.fileinput-button input {
    position: absolute;
    right: 0px;
    top: 0px;
    opacity: 0;
    font-size: 50px;
}

.btn {
    background-color: #409eff;
    color: white;
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid #dcdfe6;
    -webkit-appearance: none;
    text-align: center;
    box-sizing: border-box;
    outline: none;
    margin: 0;
    transition: .1s;
    font-weight: 500;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 4px;
}

table {
    border-left: 1px solid #ebeef5;
    border-top: 1px solid #ebeef5;
    margin-top: 40px;
    width: 900px;
}

table td,
th {
    border-bottom: 1px solid #ebeef5;
    border-right: 1px solid #ebeef5;
}

.delBtn {
    cursor: pointer;
}

/* iframe {
    margin-left: 40px;
}

li:nth-child(1) {
    color: rgb(255, 208, 75);
} */
.router-link-active{
    color: rgb(255, 208, 75);
}
</style>